-
Notifications
You must be signed in to change notification settings - Fork 332
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use gRPC to query connection end #1048
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Just a small nitpick and a question for @ancazamfir.
#[options(help = "height of the state to query", short = "h")] | ||
height: Option<u64>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ancazamfir Is that ok with you, or do you sometimes rely on being able to query the connection end at specific heights?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, we need to query specific heights (coming in the connection worker PR). And for this reason we cannot use the gRPC query.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there an issue that describes the problem we are trying to fix here? This might be ok to be used by the CLIs only. But for relaying we do need to be able to query connection at height, take proofs at given height, etc. This is currently not supported by SDK gRPC implementation and for this reason we cannot use gRPC at this point (see cosmos/ibc-go#149). Also we want to be able to test the APIs the relayer needs via the CLIs. This is why many queries have the -h
parameter that might look awkward.
#[options(help = "height of the state to query", short = "h")] | ||
height: Option<u64>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, we need to query specific heights (coming in the connection worker PR). And for this reason we cannot use the gRPC query.
As discussed in #1042, doing this query over Tendermint RPC is not very reliable, because when the connection is not found, the RPC returns empty buffer instead of proper error code. So the long term solution is still to do the query over GRPC when possible.
Perhaps we can come back to this PR again when the connection worker PR is ready, so that we have a good use case of what is currently lacking on the GRPC API and push for the fix to be done sooner. |
Goal:
Future:
|
24209ff
to
a7ad50b
Compare
I have now added back the height parameter using the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Thanks @soareschen!
Partial fix for: #1001
Description
This PR changes the
query_connection
implementation from querying the Tendermint RPC to querying the Cosmos SDK GRPC directly.Because of cosmos/ibc-go#149, the height parameter is removed from
query_connection
. However this is fine, as shown in the diff, since all calls toquery_connection
other than the command line always use the latest height of the blockchain. As a result the change should not break any existing behavior.We will need to implement retry logic any way in case a target height of interest have not been reach on the blockchain. For querying into the past, we can wait for cosmos/ibc-go#149 to be fixed first.
This fix is in parallel to #1042. The change to use GRPC call should make it less urgent to the fix by #1042. But handling uninitialized fields in protobuf3 is still an outstanding problem that needs to be solved eventually.
For contributor use:
docs/
) and code comments.Files changed
in the Github PR explorer.